package com.wlz.creational.factorymethod;

import com.wlz.creational.factorymethod.factory.Dialog;
import com.wlz.creational.factorymethod.factory.HtmlDialog;
import com.wlz.creational.factorymethod.factory.WindowsDialog;

/**
 * @author： wlz
 * @Date 2020/10/14 11:12
 * @description： TODO
 * @version: 1.0
 */
public class Demo {

    private static Dialog dialog;

    public static void main(String[] args) {

        configure();
        runBusinessLogic();

    }

    static void configure() {
        if (System.getProperty("os.name").equals("Windows 10")) {
            dialog = new WindowsDialog();
        }else {
            dialog = new HtmlDialog();
        }
    }

    static void runBusinessLogic() {
        dialog.renderWindow();
    }
}
